package com.example.demo.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.entity.Person;
import com.example.demo.service.PersonService;

@RestController
@RequestMapping("person")
public class PersonController {

	@Resource
	private PersonService personService;
	
	@RequestMapping("insert")
	public Person insert(Person person) {
		return personService.insert(person);
	}
	
	@GetMapping("find_all")
	public Object findAll() {
		return personService.findAll();
	}
	
}
